#ifndef __ANO_SENSOR_H
#define __ANO_SENSOR_H

#include "app_include.h"
#include "stdint.h"

typedef __packed struct
{
    uint8_t header;
    uint8_t addr;
    uint8_t func_code;
    uint8_t length;
}ano_sensor_header_t;


typedef __packed struct 
{
    uint8_t sum_check;
    uint8_t add_check;
}ano_sensor_end_t;

typedef struct 
{
    uint8_t mode;
    uint8_t state;
    int8_t of_raw_x;
    int8_t of_raw_y;
    int16_t of_decouple_x;
    int16_t of_decouple_y;
    int16_t of_fusion_x;
    int16_t of_fusion_y;
    int16_t of_fix_x;
    int16_t of_fix_y;
    int16_t of_integral_x;
    int16_t of_integral_y;
    uint8_t quality;
}ano_sensor_optical_flow_data_t;


typedef __packed struct 
{
    uint8_t direction;
    uint16_t angle;
    uint32_t distance;
}ano_sensor_distance_data_t;


typedef __packed struct 
{
    int16_t acc_x;
    int16_t acc_y;
    int16_t acc_z;
    int16_t gyr_x;
    int16_t gyr_y;
    int16_t gyr_z;
    uint8_t shock_sta;
}ano_sensor_imu_data_t;



typedef __packed struct 
{
    int16_t q0;
    int16_t q1;
    int16_t q2;
    int16_t q3;
}ano_sensor_quaternion_data_t;
//unit quaternion vector multiple by 10000

void ano_sensor_recv_parse(void);
void ano_sensor_init(void);
void ano_sensor_start_recv(uint8_t *data);

#endif


